/**
 *
 *  @author ala
 *  @date 2024-09-29 13:05
 */
package main

import (
	"LeetCode/linshen/segment_tree"
	_ "LeetCode/linshen/segment_tree"
	"fmt"
	"time"
)

func main() {
	n, m := 5, 9
	fmt.Println(n, uint(n))

	mbs := segment_tree.Constructor(n, m)

	now := time.Now().UnixMilli()
	fmt.Println(mbs.Scatter(2, 2))
	fmt.Printf("Scatter(2,2) 耗时：(%d)ms \n", time.Now().UnixMilli()-now)
	now = time.Now().UnixMilli()

	fmt.Println(mbs.Gather(7, 2))
	fmt.Printf("Gather(7,2) 耗时：(%d)ms \n", time.Now().UnixMilli()-now)
	now = time.Now().UnixMilli()

	fmt.Println(mbs.Gather(4, 1))
	fmt.Printf("Gather(4,2) 耗时：(%d)ms \n", time.Now().UnixMilli()-now)
	now = time.Now().UnixMilli()

	fmt.Println(mbs.Gather(6, 2))
	fmt.Printf("Gather(6,2) 耗时：(%d)ms \n", time.Now().UnixMilli()-now)
	now = time.Now().UnixMilli()

	fmt.Println(mbs.Scatter(2, 1))
	fmt.Printf("Scatter(2,1) 耗时：(%d)ms \n", time.Now().UnixMilli()-now)
	now = time.Now().UnixMilli()
}
